# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=copyq
_pkgname=CopyQ
pkgver=7.1.0
pkgrel=2
pkgdesc="Clipboard manager with searchable and editable history"
url="https://github.com/hluk/CopyQ"
arch="all !armhf"
license="GPL-3.0-or-later"
makedepends="
	cmake
	extra-cmake-modules
	knotifications5-dev
	libxfixes-dev
	libxtst-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	qt6-qtwayland-dev
	samurai
	"
options="!check" # upstream does not provide check
subpackages="$pkgname-doc $pkgname-bash-completion"
source="$pkgname-$pkgver.tar.gz::https://github.com/hluk/$_pkgname/archive/v$pkgver.tar.gz
	fix-build-with-qt6.6.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DWITH_QT6=ON
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
4320095ab75c361cc3d553c7817951eb6e74d47223f62bf6c1722e0f0b0d3ff59a1762354cf46fe0de064d516d60a467bff9ad9143b12016fc3f9e62139d3909  copyq-7.1.0.tar.gz
7e464705229c8c907813bb7224a2bd7a3f9fb1e4a076816e295adca111d89d40d3052c2afed71595a2e357cbca55d209fe7fa3dc2c38743617d6a635f20084e8  fix-build-with-qt6.6.patch
"
